package com.app.asktom.abs;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView.FindListener;
import android.widget.Button;
import android.widget.EditText;

public class AbsActivity extends Activity{
	public void disableButton(int...buttonId) {
		for(int i = 0; i < buttonId.length; i++) {
			Button button = (Button) findViewById(buttonId[i]);
			button.setEnabled(false);
		}
	}
	
	public void hideKeyboard(int id) {
		EditText txt = (EditText) findViewById(id);
		
		InputMethodManager imm = (InputMethodManager)
				this.getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.hideSoftInputFromWindow(txt.getWindowToken(), 0);	
	}
	
	public String getTextValue(int id) {
		EditText txt = (EditText) findViewById(id);
		return txt.getText().toString();
	}
	
    public void showAlertDialog(String title, String message, Boolean status) {
        AlertDialog alertDialog = new AlertDialog.Builder(this).create();
 
        // Setting Dialog Title
        alertDialog.setTitle(title);
 
        // Setting Dialog Message
        alertDialog.setMessage(message);
         
        // Setting alert dialog icon
//        alertDialog.setIcon((status) ? R.drawable.success : R.drawable.fail);
 
        // Setting OK Button
        alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
            	onClickAlertOKButton();
            }
        });
 
        // Showing Alert Message
        alertDialog.show();
    }	
    
    public void onClickAlertOKButton() {
    	
    }
}
